#include "raspberry_pi_specifics.h"


//raspberry pi specifics

PHP_FUNCTION(digitalWriteByte)
{
    zend_long value;

	ZEND_PARSE_PARAMETERS_START(1, 1)
		Z_PARAM_LONG(value)
	ZEND_PARSE_PARAMETERS_END();

    digitalWriteByte(value);
}

PHP_FUNCTION(pwmSetMode)
{
    zend_long mode;

	ZEND_PARSE_PARAMETERS_START(1, 1)
		Z_PARAM_LONG(mode)
	ZEND_PARSE_PARAMETERS_END();

    pwmSetMode(mode);

}

PHP_FUNCTION(pwmSetRange)
{
    zend_long range = 1024;

	ZEND_PARSE_PARAMETERS_START(1, 1)
		Z_PARAM_LONG(range)
	ZEND_PARSE_PARAMETERS_END();

    pwmSetRange(range);
}


PHP_FUNCTION(pwmSetClock)
{
    zend_long divisor;

	ZEND_PARSE_PARAMETERS_START(1, 1)
		Z_PARAM_LONG(divisor)
	ZEND_PARSE_PARAMETERS_END();

    pwmSetClock(divisor);
}

PHP_FUNCTION(piBoardRev)
{
    piBoardRev();
}

PHP_FUNCTION(wpiPinToGpio)
{
    zend_long wPiPin;

	ZEND_PARSE_PARAMETERS_START(1, 1)
		Z_PARAM_LONG(wPiPin)
	ZEND_PARSE_PARAMETERS_END();

    long ret = wpiPinToGpio(wPiPin);
    RETURN_LONG(ret);
}


PHP_FUNCTION(physPinToGpio)
{
    zend_long physPin;

	ZEND_PARSE_PARAMETERS_START(1, 1)
		Z_PARAM_LONG(physPin)
	ZEND_PARSE_PARAMETERS_END();

    long ret = physPinToGpio(physPin);
    RETURN_LONG(ret);
}

PHP_FUNCTION(setPadDrive)
{
    zend_long group;
    zend_long value;

	ZEND_PARSE_PARAMETERS_START(2, 2)
		Z_PARAM_LONG(group)
		Z_PARAM_LONG(value)
	ZEND_PARSE_PARAMETERS_END();

    setPadDrive(group, value);
}

//end for raspberry pi specifics